import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SurveillanceDeviceVO, SurveillanceDeviceForm, SurveillanceDeviceQuery } from '@/api/device/surveillanceDevice/types';

/**
 * 查询监视设备列表
 * @param query
 * @returns {*}
 */

export const listSurveillanceDevice = (query?: SurveillanceDeviceQuery): AxiosPromise<SurveillanceDeviceVO[]> => {
  return request({
    url: '/system/surveillanceDevice/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询监视设备详细
 * @param id
 */
export const getSurveillanceDevice = (id: string | number): AxiosPromise<SurveillanceDeviceVO> => {
  return request({
    url: '/system/surveillanceDevice/' + id,
    method: 'get'
  });
};

/**
 * 新增监视设备
 * @param data
 */
export const addSurveillanceDevice = (data: SurveillanceDeviceForm) => {
  return request({
    url: '/system/surveillanceDevice',
    method: 'post',
    data: data
  });
};

/**
 * 修改监视设备
 * @param data
 */
export const updateSurveillanceDevice = (data: SurveillanceDeviceForm) => {
  return request({
    url: '/system/surveillanceDevice',
    method: 'put',
    data: data
  });
};

/**
 * 删除监视设备
 * @param id
 */
export const delSurveillanceDevice = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/surveillanceDevice/' + id,
    method: 'delete'
  });
};
